Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

quantized64(3m) [hpux man page]

quantized64(3M) 														   quantized64(3M)

NAME
quantized64(), quantized128(), quantized32() - decimal quantize functions SYNOPSIS
DESCRIPTION
The function sets the exponent of x to the exponent of y, while attempting to keep the value the same. If the exponent is being increased, the value is correctly rounded according to the current (decimal) rounding mode. is useful for rounding to a specified number of decimal places. For example, will round x to four places to the right of the decimal point (provided the has enough digits to do so). is a version of it takes arguments and returns a result. is a version of it takes arguments and returns a result. These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward. USAGE
To use any of these functions, compile with the option. Make sure your program defines and then includes Link in the math library by specifying or on the linking command line. For more information, see the at the following site: RETURN VALUE
If the exponent of x is being increased and rounding produces a result whose numerical value is different from x, then raises the inexact exception. If the exponent of x is being decreased and the of the result has more digits than the type would allow, returns NaN and raises the invalid exception. If one or both arguments are NaN, then returns NaN. Otherwise, if only one argument returns NaN and raises the invalid exception. If both arguments returns x. ERRORS
No errors are defined. SEE ALSO
quantexpd64(3M), samequantumd64(3M), math(5). STANDARDS CONFORMANCE
These functions conform to ISO/IEC TR 24732, "Extension for the programming language C to support decimal floating-point arithmetic". HP Integrity Server Only quantized64(3M)

Check Out this Related Man Page

quantized64(3M) 														   quantized64(3M)

NAME
quantized64(), quantized128(), quantized32() - decimal quantize functions SYNOPSIS
DESCRIPTION
The function sets the exponent of x to the exponent of y, while attempting to keep the value the same. If the exponent is being increased, the value is correctly rounded according to the current (decimal) rounding mode. is useful for rounding to a specified number of decimal places. For example, will round x to four places to the right of the decimal point (provided the has enough digits to do so). is a version of it takes arguments and returns a result. is a version of it takes arguments and returns a result. These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward. USAGE
To use any of these functions, compile with the option. Make sure your program defines and then includes Link in the math library by specifying or on the linking command line. For more information, see the at the following site: RETURN VALUE
If the exponent of x is being increased and rounding produces a result whose numerical value is different from x, then raises the inexact exception. If the exponent of x is being decreased and the of the result has more digits than the type would allow, returns NaN and raises the invalid exception. If one or both arguments are NaN, then returns NaN. Otherwise, if only one argument returns NaN and raises the invalid exception. If both arguments returns x. ERRORS
No errors are defined. SEE ALSO
quantexpd64(3M), samequantumd64(3M), math(5). STANDARDS CONFORMANCE
These functions conform to ISO/IEC TR 24732, "Extension for the programming language C to support decimal floating-point arithmetic". HP Integrity Server Only quantized64(3M)
Man Page

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Rounding problem

Hi, Can any one help me in finding a solution for rounding off to 2 decimal places. I am using the following code: VAR1=.01292105263157894736 VAR2=`echo "scale=2; $VAR1 * 100" | bc -l` The result I 'm getting is 1.29210526315789473600 But I need the output as 1.29 Thanks Shash (2 Replies)
Discussion started by: shash
2 Replies

2. Shell Programming and Scripting

cut

Hi, I need to manipualte the data in the file below so that the value fields on each line are truncated to just two decimal places. Meaning i want to delet everything after two decimal places on each record in the file. I have highlighted the first value field. 02331814579359.6500000004... (3 Replies)
Discussion started by: goshort
3 Replies

3. Programming

How to deal with this error: floating constant exponent has no digits

A conditional statement cause it: if(strlen(str) < n1+1) { ------- } (7 Replies)
Discussion started by: cdbug
7 Replies

4. UNIX for Dummies Questions & Answers

Rounding a decimal

Hi, I am currently using tcsh I am trying to round a decimal number to the ten-thousandths place For instance: 1.23456 is rounded up towards 1.2346 I am not looking for truncation, but for rounding. Anyone know how to do this with awk or expr? Thanks (2 Replies)
Discussion started by: miniwheats
2 Replies

5. Programming

C++ Formatting Numbers to Strings

Hi All, Sorry to say I have 0 experience writing C++ but have been asked to write a piece of code that will take a double input and an integer for number of decimal places as well as integer for padding and output a string that represents the double formatted (with comma thousand separators -... (2 Replies)
Discussion started by: Leedor
2 Replies

6. Shell Programming and Scripting

Script to raise a integer by a exponent (while loop)

I am trying to write a script that raises a integer (m) by a exponent (n) using a while loop ex. 5 raised to the power of 2 .. I am a beginner and i dont know what is the opperand or command i have to use to make this happen..this is what i have so far... echo "Enter a integer for the... (3 Replies)
Discussion started by: jibz
3 Replies

7. Shell Programming and Scripting

Bash Rounding to 2 decimal places

I have a number in a bash variable n, and want to round it to 2 decimal places. How can I do that? n=0.0867268 Need to have num=0.09 (1 Reply)
Discussion started by: kristinu
1 Replies

8. UNIX for Dummies Questions & Answers

[Solved] To the power of using awk

Hi Guys, I got stuck to a a point where I need to find the value for (4 to the power of -2 upto 8 places after decimal .... 4^(-2) ; the result I need is upto 8 places after decimal. How is that possible? Thanks a lot!! (2 Replies)
Discussion started by: Indra2011
2 Replies

9. Shell Programming and Scripting

How to round up value upto 2 decimal places using sed?

Please help me in rounding up value upto 2 decimal palces using sed command #!/usr/bin/bash a=15.42 b=13.33 c=`echo $a*$b |bc -l` echo $c above code is is giving output "205.5486" but i want the output as "205.55" Thank you... (15 Replies)
Discussion started by: ranabhavish
15 Replies

10. Shell Programming and Scripting

Printing with decimal places from last 4 digits

I have input file like below, 201424|9999|OSS|622010|RGT|00378228764 201424|8888|OM|587079|RGT|00284329675 201424|7777|OM|587076|RGT|00128671024 201424|6666|OM|581528|RGT|00113552084 Output should be like below, should add decimal (.) from last 4 digits. ... (2 Replies)
Discussion started by: vinothsekark
2 Replies