# why multiplying with a large number gives negative and strange answers

From: Rashed Mahmood <rashidcomsis_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 20 2013 - 17:24:37 MST

Hi

I am having simple but strange problem when multiplying a number with large
number:
Here is simple example: Please check the an2 value.

ncl 0> a=0.01
ncl 1> an=a*1000000000
ncl 2> print(an)

Variable: an
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 1e+07

ncl 3> an2=a*1000000000000
ncl 4> print(an2)

Variable: an2
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) -7273800

I am not sure why an2 is -7273800? (I am using NCL 6.1.2)

Regards
Rashed

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 20 17:24:48 2013

This archive was generated by hypermail 2.1.8 : Mon Jan 06 2014 - 13:02:22 MST