virtual-labs-archive / artificial-neural-networks-iiith

This repository contains the source for Artificial Neural Networks Lab IIITH
http://cse22-iiith.vlabs.ac.in
Other
5 stars 238 forks source link

The numeric literal '30B' will have at different value at runtime. #40

Open BSravanthi opened 6 years ago

BSravanthi commented 6 years ago

The numeric literal will have at different value at runtime, which can happen if you provide too much precision in a floating point number. This may result in numeric calculations being in error.

Example(s):

var a = 9; // Ok
var b = 999999999999999; // Ok
var c = 999999999999999999999; // Not good
var w = 1.12e-4; // Ok
var x = 1.12; // Ok
var y = 1.1234567890123; // Ok
var z = 1.12345678901234567; // Not good

Please refer to the following link to fix similar issues. https://app.codacy.com/app/BSravanthi/artificial-neural-networks-iiith/issues?&filters=W3siaWQiOiJMYW5ndWFnZSIsInZhbHVlcyI6W251bGxdfSx7ImlkIjoiQ2F0ZWdvcnkiLCJ2YWx1ZXMiOlsiRXJyb3IgUHJvbmUiXX0seyJpZCI6IkxldmVsIiwidmFsdWVzIjpbbnVsbF19LHsiaWQiOiJQYXR0ZXJuIiwidmFsdWVzIjpbMzkyOF19LHsidmFsdWVzIjpbXX1d

thecoderxman commented 5 years ago

But those numerical literals are there for a reason, if i reduce to smaller size will it serve the same purpose as earlier @BSravanthi