Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

Commented Unassigned: get_One for Complex and Complex32 [5728]

$
0
0
I'm not sure if it's proper issue but in Visual F#, the usual pown function (with integer argument) requires its first argument to have get_One. Complex and Complex32 type have one instead of get_One and thus I can't use pown. Obviously, System.Numerics.Complex has the property One (and hence get_One.) It would be nice if we have get_One for compatibility.

Alternatively, you could provide Complex.pown and Complex32.pown as in BigNumber. I can use float version of pow function, but it simply doesn't feel right for me to use it for small powers like squares or cubes.
Comments: Interesting. Our Complex types implement One exactly like System.Numerics.Complex: as a public static readonly field (and thus technically not a member). However, from what you describe it seems as if F# core extends the Complex type with a One property. If so, we can do exactly the same thing in our F# package. For reference: `pown : ^T -> int -> ^T (requires ^T with static member One and ^T with static member op_Multiply and ^T with static member (/))`

Viewing all articles
Browse latest Browse all 971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>