fix for INF being 0 on some systems