You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc comment below should be hidden from end users because the terms value and exp are not defined anywhere end users can see.
// Decimal represents a fixed-point decimal. It is immutable.// number = value * 10 ^ exp ← (THIS)typeDecimalstruct {
value*big.Int// NOTE(vadim): this must be an int32, because we cast it to float64 during// calculations. If exp is 64 bit, we might lose precision.// If we cared about being able to represent every possible decimal, we// could make exp a *big.Int but it would hurt performance and numbers// like that are unrealistic.expint32
}
Some suggestions:
Prevent the line from being rendered. (I don't know it's technically possible in Go though.)
Just move the line inside struct{ ... }. Maybe just after the opening brace {.
Keep the comment but define the terms value and exp. I think this approach is very interesting as I was personally impressed when I first read the source code to know how Decimal was implemented.
The text was updated successfully, but these errors were encountered:
The doc comment below should be hidden from end users because the terms
value
andexp
are not defined anywhere end users can see.Some suggestions:
Prevent the line from being rendered. (I don't know it's technically possible in Go though.)
Just move the line inside
struct{ ... }
. Maybe just after the opening brace{
.Keep the comment but define the terms
value
andexp
. I think this approach is very interesting as I was personally impressed when I first read the source code to know howDecimal
was implemented.The text was updated successfully, but these errors were encountered: