To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3047
3046  |  3048
Subject: 
Float and int
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 29 Dec 2002 22:09:33 GMT
Viewed: 
2708 times
  
Does anyone know what the maximum and minimum size of integer which can be
stored is?
Likewise, what is the floating point accuracy of BrickOS for variables of
type "float" and "double" (is there such thing in BrickOS?) ?

Both of these questions could be answered if someone could give me a
breakdown of how integers and floats are stored by the microprocessor (the
number of bits for the exponent and mantissa, etc).

Many thanks,
Ralph Clark



Message has 2 Replies:
  Re: Float and int
 
(...) int is 16 bits, big endian, signed. It goes from -32768 to 32767. unsigned int goes from 0 to 65535. char is 8, long is 32, long long is 64, with the standard limits. Floats and doubles are emulated in software, as the H8/300 processor has no (...) (22 years ago, 30-Dec-02, to lugnet.robotics.rcx.legos)
  Re: Float and int
 
(...) You should look in the gnu gcc compiler documentation for this. Float support is not OS but compiler specific. As I recall, gcc uses IEEE float format, the specification should be found somewhere in the net. But doing float with the brick is (...) (22 years ago, 30-Dec-02, to lugnet.robotics.rcx.legos)

6 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR