Sponsored Content
Top Forums Programming Internal representation of double Post 302453945 by fpmurphy on Thursday 16th of September 2010 11:29:51 PM
Old 09-17-2010
Actually SEQ1 and SEQ2 are different IEEE 754 binary64 numbers according to my calculations with SEQ2 being the "correct" answer.

SEQ1: 0 0 0 0 128 20 174 27 64 = 401BAE1480000000 = 6.9200000762939450

Bit 62 (Sign bit) 0 (+)
Bits 62 - 52 (Exponent) 10000000001 = 1025 - 1023 = 2
Bits 51 - 0 (Significand) 1 .1011101011100001010010000000000000000000000000000000 = 1.7300000190734863


SEQ2: 174 71 225 122 20 174 27 64 = 401BAE147AE147AE = 6.9200000000000000

Bit 62 (Sign bit) 0 (+)
Bits 62 - 52 (Exponent) 10000000001 = 1025 - 1023 = 2
Bits 51 - 0 (Significand) 1 .1011101011100001010001111010111000010100011110101110 = 1.7300000000000000

The printf format precision (%.6f) masked the difference.
This User Gave Thanks to fpmurphy For This Post:
 

8 More Discussions You Might Find Interesting

1. Solaris

Disk Representation - what is this c1t1d0s2 represent?

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)
Discussion started by: tlee
2 Replies

2. UNIX for Advanced & Expert Users

Forwarding internal internet packets to internal webserver using iptables

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)
Discussion started by: mshindo
1 Replies

3. Shell Programming and Scripting

Question on file owner name representation

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)
Discussion started by: Arunprasad
6 Replies

4. Programming

problems with pointers and internal representation.

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)
Discussion started by: lamachejo
3 Replies

5. Shell Programming and Scripting

Convert a matrix to sparse representation

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)
Discussion started by: shoaibjameel123
1 Replies

6. Homework & Coursework Questions

Splitting a numbers binary representation for a double.

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)
Discussion started by: robin_simple
5 Replies

7. UNIX and Linux Applications

Graphical Representation of mpstat.out file

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)
Discussion started by: Kathraji
1 Replies

8. Programming

How bit representation of a number can be done in c?

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
atomic_bits(9F) 														   atomic_bits(9F)

NAME
atomic_bits, atomic_set_long_excl, atomic_clear_long_excl - atomic set and clear bit operations SYNOPSIS
#include <sys/atomic.h> int atomic_set_long_excl(volatile ulong_t *target, uint_t bit); int atomic_clear_long_excl(volatile ulong_t *target, uint_t bit); The atomic_set_long_excl() and atomic_clear_long_excl() functions perform an exclusive atomic bit set or clear operation on target. The value of bit specifies the number of the bit to be modified within target. Bits are numbered from zero to one less than the maximum number of bits in a long. If the value of bit falls outside of this range, the result of the operation is undefined. The atomic_set_long_excl() and atomic_clear_long_excl() functions return 0 if bit was successfully set or cleared. They return -1 if bit was already set or cleared. No errors are defined. These functions can be called from user or interrupt context. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ atomic_add(9F), atomic_and(9F), atomic_cas(9F), atomic_dec(9F), atomic_inc(9F), atomic_or(9F), atomic_swap(9F), membar_ops(9F), attributes(5), atomic_ops(3C) 13 May 2005 atomic_bits(9F)
All times are GMT -4. The time now is 03:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy