The difference between float and double is nil as far as printf's concerned, they get promoted to double these days when they get passed as varargs.
Except when it comes to the degree of precision desired...old compilers used to automatically convert floats to doubles but that is no longer practised and if that is indeed the case then all the more reason to use the double format specification instead of the float.
---------- Post updated at 02:59 PM ---------- Previous update was at 01:59 PM ----------
Quote:
Originally Posted by fpmurphy
Actually SEQ1 and SEQ2 are different IEEE 754 binary64 numbers according to my calculations with SEQ2 being the "correct" answer.
The printf format precision (%.6f) masked the difference.
Its good you posted the results as I was getting confused why my systems were reporting different...so it is an endianness issue and here are the results from an AIX and HPUX machine which are both big endian.
Hi All,
Can you please advise what the 't' letters stands for?
I understand the letter for the following "c1t1d0s2":
c = disk Controller
t = ?
d = disk number ID.
s = slice or partition of the disk
Thanks (2 Replies)
Hi,
I need to redirect internal internet requests to a auth client site siting on the gateway. Currently users that are authenticated to access the internet have there mac address listed in the FORWARD chain. All other users need to be redirected to a internal site for authentication.
Can... (1 Reply)
Hi All,
I came across a situation where i saw a directory name given below:
drwxrwxrwx 5 121973 staff 8192 Apr 26 23:47 arunpr
Just for your info:
1. All our application user ids are LDAP.
2. Hence we will not see any details of user in /etc/passwd file and i believe this could... (6 Replies)
I am trying to implement the representation in the attached file.
class matriz {
private:
int fil,col;
int **filaspointer;
int *buffer;
public:
matriz();
matriz(int fil,int col);
... (3 Replies)
Hi All,
I have a matrix stored in a file matrix.mtx and looks like this:
1 0.5 0.33 0.25
0 0.33 0.25 0.2
0 0 0 0.16
0 0 0 0.14
I want to convert this matrix to its sparse representation like the one give below (sparse_matrix.mtx). This means that above matrix has been converted to its... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Split a 64bit hexadecimal number into two 32 bit numbers or keys.
2. Relevant commands, code, scripts,... (5 Replies)
hi everyone,
We've generated mpstat.out file monitoring cpu utilization and the file is ready now.Wanted to generate graphical charts for the same output data.
Can anyone pleas suggest tool for the same.? (1 Reply)
I have an assignment in which a character is the input of which some bits(from a position to certain position) are to be inverted (1's complement) and then the resultant character is to be returned....for example
unsigned char x = J from p = 3 to offset n = 5
01001010 inverted to... (1 Reply)
Discussion started by: ezee
1 Replies
LEARN ABOUT REDHAT
nextafter
NEXTAFTER(3) libc math functions NEXTAFTER(3)NAME
nextafter, nexttoward - floating point number manipulation
SYNOPSIS
#include <math.h>
double nextafter(double x, double y);
float nextafterf(float x, float y);
long double nextafterl(long double x, long double y);
double nexttoward(double x, long double y);
float nexttowardf(float x, long double y);
long double nexttowardl(long double x, long double y);
DESCRIPTION
The nextafter() functions return the next representable neighbor of x in the direction towards y. The size of the step between x and the
result depends on the type of the result. If x = y the function simply returns y. If either value is NaN, then NaN is returned. Other-
wise a value corresponding to the value of the least significant bit in the mantissa is added or subtracted, depending on the direction.
The nexttoward() functions do the same as the nextafter() functions, except that they have a long double second argument.
These functions will signal overflow or underflow if the result goes outside of the range of normalized numbers.
CONFORMING TO
C99. This function is defined in IEC 559 (and the appendix with recommended functions in IEEE 754/IEEE 854).
SEE ALSO nearbyint(3)GNU 2002-08-10 NEXTAFTER(3)