This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hawk777's profile picture

[1.33] value outside acceptable range

Started by Hawk777, 07 May 2012 - 03:36 PM
Hawk777 #1
Posted 07 May 2012 - 05:36 PM
This, at server startup:

2012-05-07 09:32:44 [WARNING] Configuration for mod_ComputerCraft.enableAPI_http found value 0 outside acceptable range 4.9E-324,1.7976931348623157E308

Looks like it's an ulp (unit in last place) or so above zero on the minimum value. Bug in CC? Bug in Forge? I don't really know, but it looks like it's a bug somewhere.
Cloudy #2
Posted 07 May 2012 - 06:03 PM
This, at server startup:

2012-05-07 09:32:44 [WARNING] Configuration for mod_ComputerCraft.enableAPI_http found value 0 outside acceptable range 4.9E-324,1.7976931348623157E308

Looks like it's an ulp (unit in last place) or so above zero on the minimum value. Bug in CC? Bug in Forge? I don't really know, but it looks like it's a bug somewhere.

Woah, weird! I'd say bug in Forge - but can't see how that is the case either! Does the http API still get enabled?
Hawk777 #3
Posted 07 May 2012 - 06:04 PM
Haven't a clue; I didn't test. If you note "found value 0" I was actually intending for it to be disabled, but I don't really have time to check right now. It would make sense that this bug wouldn't have been caught before if perhaps all the testers had the API enabled (since 1 is indeed between 4.9e-324 and 1.79…e308, it's only zero that's out of range).
Edited on 07 May 2012 - 04:05 PM
Cloudy #4
Posted 07 May 2012 - 06:11 PM
Haven't a clue; I didn't test. If you note "found value 0" I was actually intending for it to be disabled, but I don't really have time to check right now. It would make sense that this bug wouldn't have been caught before if perhaps all the testers had the API enabled (since 1 is indeed between 4.9e-324 and 1.79…e308, it's only zero that's out of range).

Ahh, so it is a bug somewhere - but will not affect anything by the looks of it. Well, good to know - I'll check into it anyway from the decompiled code and see where the bug lies.
Hawk777 #5
Posted 07 May 2012 - 06:15 PM
I don't know for sure it didn't unintentionally enable the HTTP API when I wanted it disabled; if CC just checks whether the returned value is nonzero, and if Forge clamps the provided value to lie within the valid range, then that could happen: 4.9e-324 is nonzero. On the other hand if CC (or Forge for that matter) casts to int first and then checks, it really won't break anything because ((int) 4.9e-324)==0.
Cloudy #6
Posted 07 May 2012 - 07:15 PM
I don't know for sure it didn't unintentionally enable the HTTP API when I wanted it disabled; if CC just checks whether the returned value is nonzero, and if Forge clamps the provided value to lie within the valid range, then that could happen: 4.9e-324 is nonzero. On the other hand if CC (or Forge for that matter) casts to int first and then checks, it really won't break anything because ((int) 4.9e-324)==0.

Well from the mod_ComputerCraft class:

@MLProp
public static int enableAPI_http = 0;

It is casted to int before comparing if it is over > 0, so should be ok.