Sponsored Content
Full Discussion: how can i store it ?
Top Forums Programming how can i store it ? Post 11514 by rwb1959 on Thursday 6th of December 2001 04:00:39 PM
Old 12-06-2001
Take a look at the IEEE double precision
representation...

http://www.math.grin.edu/~stone/cour...EEE-reals.html

The greatest number that has an exact IEEE single-precision representation is
340282346638528859811704183484516925440.0 (2^128 - 2^104)

The greatest real number that can be represented
exactly as a double-precision real
is 2^1024 - 2^971, and
the least positive real that can be so
represented is 2^-1074
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to store username

I would like to write files to a directory (not under the user's home) which includes the userid. Example: userid = john John's home dir is /home/john I want to create a directory /var/prog/john MSG_HOME=/var/prog; export MSG_HOME; USR_NAME=@@@@; export USER_NAME; if ; ... (3 Replies)
Discussion started by: dinplant
3 Replies

2. Shell Programming and Scripting

grep and store

When i grep a file and store it in a file it is storing as a zero byte file any way to avoid that..... (6 Replies)
Discussion started by: arunkumar_mca
6 Replies

3. Shell Programming and Scripting

Cannot store integer value

Hi , I have code like below in my ksh script, but getting an error as SP2-0253: data item 1 ("SAMPLE_ID") will not fit on line , pls help me. thanks. if (( CHECKS == 0 )) || (( CHECKS == 1 )) then V_SAMPLE_ID=$( $ORACLE_HOME/bin/sqlplus -S / <<EOF whenever sqlerror exit 1... (5 Replies)
Discussion started by: bennichan
5 Replies

4. Shell Programming and Scripting

store key value

Hi All, I have a string like echo $var D_PROC=20080723 I_REPROC=N C_TYPE_FILE=INBOUND Now I want it be stored in an associative array so that when we echo $arr it should be 20080723 (5 Replies)
Discussion started by: thana
5 Replies

5. Programming

Read and Store

How can I read from the user input and store each word individually for example word1 word2 number1 number2 word 3 number3 server 192.25.1.1 55555 22 logged 15 I need to store and manipulate each word/number individually and these inputs are entered by the user. (7 Replies)
Discussion started by: Peevish
7 Replies

6. UNIX for Dummies Questions & Answers

How to grep and store in a file

Guys, I was wondering what command can be used to parse the "LaxOrdID" field into a separate file? These messages are in thousands and I need to perform a comparision. (6 Replies)
Discussion started by: DallasT
6 Replies

7. Shell Programming and Scripting

How to store value from a function and use it?

There is one function to calculate previous day value and then touch one file with that date.The problem is i am getting the previous day value but not able to store it in other variable and use it. PREVIOUS_DATE_FUNCTION() { date '+%m %d %Y' | { read MONTH DAY YEAR DAY=`expr "$DAY" -... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies

8. Shell Programming and Scripting

I can't store value in the variable

!#bin/bash clear var= grep @gmail.com email.txt | wc -l echo $var echo $var exit 0 OUTPUT: 1000 _ _ Where _ represent space (no value or nothing) (4 Replies)
Discussion started by: Muhammad Rehan
4 Replies

9. UNIX for Beginners Questions & Answers

Where to store backup?

I am on Ubuntu 18.04 and I have never created a backup. Recently my computer started acting sluggish until I restarted it but it got me concerned. So I figured I better make a backup (work pc) just in case. However, I have honestly never made one before. It's asking me where I want to save the... (6 Replies)
Discussion started by: Circuits
6 Replies
FLOAT(3)						   BSD Library Functions Manual 						  FLOAT(3)

NAME
float -- description of floating-point types available on OS X and iOS DESCRIPTION
This page describes the available C floating-point types. For a list of math library functions that operate on these types, see the page on the math library, "man math". TERMINOLOGY
Floating point numbers are represented in three parts: a sign, a mantissa (or significand), and an exponent. Given such a representation with sign s, mantissa m, and exponent e, the corresponding numerical value is s*m*2**e. Floating-point types differ in the number of bits of accuracy in the mantissa (called the precision), and set of available exponents (the exponent range). Floating-point numbers with the maximum available exponent are reserved operands, denoting an infinity if the significand is precisely zero, and a Not-a-Number, or NaN, otherwise. Floating-point numbers with the minimum available exponent are either zero if the significand is precisely zero, and denormal otherwise. Note that zero is signed: +0 and -0 are distinct floating point numbers. Floating-point numbers with exponents other than the maximum and minimum available are called normal numbers. PROPERTIES OF IEEE-754 FLOATING-POINT Basic arithmetic operations in IEEE-754 floating-point are correctly rounded: this means that the result delivered is the same as the result that would be achieved by computing the exact real-number operation on the operands, then rounding the real-number result to a floating-point value. Overflow occurs when the value of the exact result is too large in magnitude to be represented in the floating-point type in which the compu- tation is being performed; doing so would require an exponent outside of the exponent range of the type. By default, computations that result in overflow return a signed infinity. Underflow occurs when the value of the exact result is too small in magnitude to be represented as a normal number in the floating-point type in which the computation is being performed. By default, underflow is gradual, and produces a denormal number or a zero. All floating-points number of a given type are integer multiples of the smallest non-zero floating-point number of that type; however, the converse is not true. This means that, in the default mode, (x-y) = 0 only if x = y. The sign of zero transforms correctly through multiplication and division, and is preserved by addition of zeros with like signs, but x - x yields +0 for every finite floating-point number x. The only operations that reveal the sign of a zero are x/(+-0) and copysign(x,+-0). In particular, comparisons (x > y, x != y, etc) are not affected by the sign of zero. The sign of infinity transforms correctly through multiplication and division, and infinities are unaffected by addition or subtraction of any finite floating-point number. But Inf-Inf, Inf*0, and Inf/Inf are, like 0/0 or sqrt(-3), invalid operations that produce NaN. NaNs are the default results of invalid operations, and they propagate through subsequent arithmetic operations. If x is a NaN, then x != x is TRUE, and every other comparison predicate (x > y, x = y, x <= y, etc) evaluates to FALSE, regardless of the value of y. Additionally, predicates that entail an ordered comparison (rather than mere equality or inequality) signal Invalid Operation when one of the arguments is NaN. IEEE-754 provides five kinds of floating-point exceptions, listed below: Exception Default Result __________________________________________ Invalid Operation NaN or FALSE Overflow +-Infinity Divide by Zero +-Infinity Underflow Gradual Underflow Inexact Rounded Value NOTE: An exception is not an error unless it is handled incorrectly. What makes a class of exceptions exceptional is that no single default response can be satisfactory in every instance. On the other hand, because a default response will serve most instances of the exception satisfactorily, simply aborting the computation cannot be justified. For each kind of floating-point exception, IEEE-754 provides a flag that is raised each time its exception is signaled, and remains raised until the program resets it. Programs may test, save, and restore the flags, or a subset thereof. PRECISION AND EXPONENT RANGE OF SPECIFIC FLOATING-POINT TYPES On both OS X and iOS, the type float corresponds to IEEE-754 single precision. A single-precision number is represented in 32 bits, and has a precision of 24 significant bits, roughly like 7 significant decimal digits. 8 bits are used to encode the exponent, which gives an expo- nent range from -126 to 127, inclusive. The header <float.h> defines several useful constants for the float type: FLT_MANT_DIG - The number of binary digits in the significand of a float. FLT_MIN_EXP - One more than the smallest exponent available in the float type. FLT_MAX_EXP - One more than the largest exponent available in the float type. FLT_DIG - the precision in decimal digits of a float. A decimal value with this many digits, stored as a float, always yields the same value up to this many digits when converted back to decimal notation. FLT_MIN_10_EXP - the smallest n such that 10**n is a non-zero normal number as a float. FLT_MAX_10_EXP - the largest n such that 10**n is finite as a float. FLT_MIN - the smallest positive normal float. FLT_MAX - the largest finite float. FLT_EPSILON - the difference between 1.0 and the smallest float bigger than 1.0. On both OS X and iOS, the type double corresponds to IEEE-754 double precision. A double-precision number is represented in 64 bits, and has a precision of 53 significant bits, roughly like 16 significant decimal digits. 11 bits are used to encode the exponent, which gives an exponent range from -1022 to 1023, inclusive. The header <float.h> defines several useful constants for the double type: DBL_MANT_DIG - The number of binary digits in the significand of a double. DBL_MIN_EXP - One more than the smallest exponent available in the double type. DBL_MAX_EXP - One more than the exponent available in the double type. DBL_DIG - the precision in decimal digits of a double. A decimal value with this many digits, stored as a double, always yields the same value up to this many digits when converted back to decimal notation. DBL_MIN_10_EXP - the smallest n such that 10**n is a non-zero normal number as a double. DBL_MAX_10_EXP - the largest n such that 10**n is finite as a double. DBL_MIN - the smallest positive normal double. DBL_MAX - the largest finite double. DBL_EPSILON - the difference between 1.0 and the smallest double bigger than 1.0. On Intel macs, the type long double corresponds to IEEE-754 double extended precision. A double extended number is represented in 80 bits, and has a precision of 64 significant bits, roughly like 19 significant decimal digits. 15 bits are used to encode the exponent, which gives an exponent range from -16383 to 16384, inclusive. The header <float.h> defines several useful constants for the long double type: LDBL_MANT_DIG - The number of binary digits in the significand of a long double. LDBL_MIN_EXP - One more than the smallest exponent available in the long double type. LDBL_MAX_EXP - One more than the exponent available in the long double type. LDBL_DIG - the precision in decimal digits of a long double. A decimal value with this many digits, stored as a long double, always yields the same value up to this many digits when converted back to decimal notation. LDBL_MIN_10_EXP - the smallest n such that 10**n is a non-zero normal number as a long double. LDBL_MAX_10_EXP - the largest n such that 10**n is finite as a long double. LDBL_MIN - the smallest positive normal long double. LDBL_MAX - the largest finite long double. LDBL_EPSILON - the difference between 1.0 and the smallest long double bigger than 1.0. On ARM iOS devices, the type long double corresponds to IEEE-754 double precision. Thus, the values of the LDBL_* macros are identical to those of the corresponding DBL_* macros. SEE ALSO
math(3), complex(3) STANDARDS
Floating-point arithmetic conforms to the ISO/IEC 9899:2011 standard. BSD
March 28, 2007 BSD
All times are GMT -4. The time now is 08:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy