File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ func (f FixedPoint[T]) ToFloat64() float64 {
7474
7575// Mul returns a new FixedPoint that is the result of multiplying the existing
7676// int by the passed one.
77+ //
78+ // NOTE: This function assumes that the scales of the two FixedPoint values are
79+ // identical. If the scales differ, the result may be incorrect.
7780func (f FixedPoint [T ]) Mul (other FixedPoint [T ]) FixedPoint [T ] {
7881 multiplier := NewInt [T ]().FromFloat (math .Pow10 (int (f .Scale )))
7982
@@ -87,6 +90,9 @@ func (f FixedPoint[T]) Mul(other FixedPoint[T]) FixedPoint[T] {
8790
8891// Div returns a new FixedPoint that is the result of dividing the existing int
8992// by the passed one.
93+ //
94+ // NOTE: This function assumes that the scales of the two FixedPoint values are
95+ // identical. If the scales differ, the result may be incorrect.
9096func (f FixedPoint [T ]) Div (other FixedPoint [T ]) FixedPoint [T ] {
9197 multiplier := NewInt [T ]().FromFloat (math .Pow10 (int (f .Scale )))
9298
You can’t perform that action at this time.
0 commit comments