# Homework Help: Quick rounding question

1. Dec 23, 2008

### Gwilim

I'm doing a past exam paper and there's a question telling me to round to 4 digits. Does this mean rounding to 4 significant figures, 4 decimal places, or something else? Or is it ambiguous? (I really hope it isn't this one)

2. Dec 23, 2008

### mgb_phys

I would have said 4 sig figures but it is poorly worded

3. Dec 23, 2008

### symbolipoint

mg_phys is correct, unless the topic of the question demands the other interpretation. The specification for rounding "... to 4 digits" does not say anything about which direction or place value in relation to the decimal point; so the wording must mean "4 significant figures".

4. Dec 23, 2008

### Gwilim

In the context of the module we are dealing with word lengths. So, in a fixed point number, zeros after the decimal point would count as digits? I think significant figures is probably the safest assumption when fixed point is not explicitly specified, unless someone tells me otherwise given this information.

5. Dec 23, 2008

### mgb_phys

Remember the zero BEFORE the decimal point is not significant
All these are 4 sig figures 1.234, 1.230, 0.1234, 0.1230

6. Dec 23, 2008

### Gwilim

Right, but 0.01234 is 4 significant figures, and 0.0123 is the same as a fixed point number rounded to 4 digits?

7. Dec 23, 2008

### mgb_phys

Yes, think of it as 1.234 x10^-2

0.0123 is three sig figs = 1.23 x10^-2

8. Dec 23, 2008

### Gwilim

This is where I'm unsure.. 1.23x10^-2 is a floating point number. Do I just assume a number has a floating point unless I'm told it's fixed, even when it's presented as a fixed point? This has to do with how numbers are stored on a computer rather than rounding off measurements.

I suppose my guess is as good as anybodys.

9. Dec 23, 2008

### mgb_phys

Storing floating point number sin a computer is a little different.
They are stored in exponent notation ( 0.1234 E-2 )
But the fraction par tis of course stored as binary - so it is really the sum of 1/2 + 1/4 + 1/8 + 1/16 + 1/32 and so. Then there is an exponent stored as a regular binary number.
This gives some odd results, numbers which fit into the powers of 2 can be stored exactly while other simple fractions like 1/10 can only be approximated.

If you are interested the normal way of storing floats is called IEEE 754