On Thu, Nov 29, 2018 at 7:47 AM robert engels <reng...@ix.netcom.com> wrote:

> For those interesting in financial apps, I have released ‘fixed' at
https://github.com/robaho/fixed a high performance fixed-point math library
primarily designed for to work with currencies.

- To me type name 'fixed.Fixed' sounds like Javaism. Go code usually tries
to avoid such stutter: 'sort.Interface', 'big.Int' etc.

- A struct with a single field could be replaced by the field itself. OTOH,
it would enable coding errors by applying arithmetic operators to it
directly, so it's maybe justified in this case if that was the intention.

- I'd prefer a single constructor 'New(int64)' and methods 'SetString',
'SetFloat' etc.

> The benchmarks: (Decimal is the shopspring library, big Int/Float are the
stdlib)

I don't consider comparing performances of 64 bit integer arithmetic and
arbitrary sized arithmetic very useful.

-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to