-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception with "N0" format string and integer value of 0 #118
Comments
- fix nanoframework/Home#215 - fix nanoframework/Home#118 Signed-off-by: José Simões <jose.simoes@eclo.solutions>
- fix nanoframework/Home#215 - fix nanoframework/Home#118 Signed-off-by: José Simões <jose.simoes@eclo.solutions>
Issue is still present, as the quick&dirty fix has been removed. |
Looks like it is the expected behaviour, in fact. See last sentence :
Taken from : http://www.cplusplus.com/reference/cstdio/printf/ The exception is not the expected behaviour on the managed side, however. |
Waiting for the PR to be submitted on the CoreLibrary repo. |
From nf-interpreter created by MikroBusNet : nanoframework/nf-interpreter#285
The following code will throw a 'System.ArgumentOutOfRangeException' in mscorlib.dll :
If myVar is 0 and precision is 0 for the 'N' format string, then the FormatNative() method is returning an empty string, which will raise the exception in the InsertGroupSeparators() method (in Number.cs), since original.Length is 0 :
We can see the same behaviour for all integral types except long and ulong.
The text was updated successfully, but these errors were encountered: