Dechenjm / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

Assignment during declaration error #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With version 8989f1b8690d run the following code:

import crack.io cout;
float PI=3.141592;
float val=0.5*PI;
cout `val=$val, PI=$PI\n`;

$> crack -l lib test_bug.crk
val=15.707960, PI=3.141592

Seems like val is _5_ time PI instead of 0.5
Changing the line assigning val to the following doesn't make a difference:
float val=PI*0.5;

Original issue reported on code.google.com by Conrad.S...@gmail.com on 29 Oct 2010 at 12:11

GoogleCodeExporter commented 9 years ago
This is a problem with floating point constants:

  import crack.io cout;
  cout `$(0.5)\n`;

produces: 5

Shannon, can you take a look at this?

Original comment by mind...@gmail.com on 29 Oct 2010 at 9:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision ae618271ab.

Original comment by weyrick on 29 Oct 2010 at 5:22

GoogleCodeExporter commented 9 years ago
fixed in ae618271abe3

Original comment by weyrick on 29 Oct 2010 at 5:22