Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
simonbyrne
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
simonbyrne
8y ago
Apologies, I realise my comment was a bit snarky. Pony looks like a really neat language: I'll be interested to see what you do with it. Unfortunately LLVM considers division overflow undefined: http://llvm.org/docs
62.
▲
by
simonbyrne
8y ago
What about I64.min_value() / (-1)? Why does that give 0? If you're doing wrap-around arithmetic it should give I64.min_value(). https://tio.run/##K8jPq/z/PzG5JL9IwTcxM49LAQjyUssVkotSE0tSNV...
63.
▲
by
simonbyrne
8y ago
Well, I have indeed spent more time thinking about this than is probably healthy, but here are some nice edge cases to think about: - https://github.com/JuliaLang/julia/issues/14826 mod(-eps(), 4.0)
64.
▲
by
simonbyrne
8y ago
I take the opinion that people should have the option to round division (and compute remainders) however they want: down, up, to zero, to nearest (with different options for breaking ties). https://github.com/JuliaLang/
65.
▲
by
simonbyrne
8y ago
The other point is that remainder makes much more sense for floating point numbers, as it's exact. mod on the other hand is not, and is fiendishly difficult to get "right" (if that is even possible).
66.
▲
by
simonbyrne
8y ago
I guess because remainder is simpler to implement? (anecdotally, the assembly generated by @code_native in Julia is much shorter for remainder) In my opinion neither are used sufficiently often to justify taking up a valuable ASCII symbol (
67.
▲
by
simonbyrne
8y ago
We would love to have more professional programmers contribute: unfortunately those 1-based indices put them off. More seriously: part of the problem does seem to be that Julia does have some significant differences from "traditional&q
68.
▲
by
simonbyrne
8y ago
Out of curiosity: what language has a package ecosystem that in your opinion does do this right?
69.
▲
by
simonbyrne
8y ago
Also, I was actually a postdoc...
70.
▲
by
simonbyrne
8y ago
What language defines % as mod and not remainder?
71.
▲
by
simonbyrne
8y ago
> I really want my zeroth frequency in my zeroth bin That's precisely what it does! > I also cringe at languages where -1 mod N does not equal N-1. julia> mod(-1,10) 9
72.
▲
by
simonbyrne
8y ago
Well for FFTs you really want periodic indices. Luckily Julia has those too: https://github.com/JuliaArrays/FFTViews.jl
73.
▲
by
simonbyrne
8y ago
Actually, you can try 0.7: this is more or less equivalent, but is backwards compatible with 0.6 (it will warn when incompatible uses are used). Of course, more time would have been nice, but you can always find a reason for a delay. At som
74.
▲
by
simonbyrne
8y ago
A slight quibble: FFTs are more naturally indexed periodically. Luckily, Julia has that covered: https://github.com/JuliaArrays/FFTViews.jl
75.
▲
by
simonbyrne
8y ago
No, just need to wait for IJulia to be updated. I imagine it will be a day or two.
76.
▲
by
simonbyrne
8y ago
It turns out that compilers are pretty good at eliding constant integer offsets.
77.
▲
by
simonbyrne
8y ago
I don't think _any_ language has got exception handling handling right yet, despite a lot of effort. The problems are particularly apparent in parallel and multithreaded programs. That said, I am optimistic Julia will have a good solut
78.
▲
by
simonbyrne
8y ago
I've heard this before: what is F#'s main draw over other functional languages in finance? Is it simply that it comes already bundled with .NET?
79.
▲
by
simonbyrne
8y ago
Conversely, the worlds most widely used financial software (Microsoft Excel) uses binary floating point under the hood.
80.
▲
by
simonbyrne
8y ago
I'm not really sure, but from a quick skim it seems that the Intel library provides standard math functions (log, exp, sin, etc.), whereas the speleotrove library does not. Also the speleotrove one doesn't appear to have been upda
81.
▲
by
simonbyrne
8y ago
Also, you force people to take a break. It's pretty common in finance to require a 2 week consecutive holiday every so often: one justification being that if someone was cooking the books, the person taking over their role would probab
82.
▲
by
simonbyrne
8y ago
Your best bet might be wrapping the Intel decimal floating point library: https://software.intel.com/en-us/articles/intel-decimal-floa... This is a software implementation of the standardized IEEE decimal format.
83.
▲
by
simonbyrne
8y ago
They weren't trying to replace the system, just emulate it for testing and simulation purposes: e.g. test how new rates would affect existing policy holders. Insurance policies (the contracts) just have final premiums (sometimes they m
84.
▲
by
simonbyrne
8y ago
There is a little more to it than "languages don't provide decimal or fixed point". Both Java and Python provide decimal implementations as part of their standard libraries, and languages don't provide fixed-point as it&
85.
▲
by
simonbyrne
8y ago
I've recently moved to the US from the UK, and I've had several Americans mention that they would like to visit Europe but are worried about the danger of terrorism. I tried to explain that any increased risk of terrorism is massi
86.
▲
by
simonbyrne
8y ago
It also introduces interesting financial arrangements. e.g. rather than profiting on the electricity directly, they make more money by selling options to sell at a fixed price at peak times.
87.
▲
by
simonbyrne
8y ago
Ah, I should have done more googling. I guess the AVX-512 ones are marginally more accurate?
88.
▲
by
simonbyrne
8y ago
It is worth noting that with AVX-512, Intel has introduced a native inverse sqrt approximation (VRSQRT14).
89.
▲
by
simonbyrne
8y ago
Well, in Julia it's an incomplete expression (Y is a variable, % is the infix operator for remainder, and # a line comment (the $ is used for string/command interpolation, but is commented out).
90.
▲
by
simonbyrne
8y ago
Even reinsurance has limits, and large earthquakes on major metropolitan centres are basically the one thing that will exceed them (floods can be bad too, but the risks are more predictable, and are often excluded from policies in high-risk
More ›