フォロー

EMLでの足し算、つまりこうだね><
2+3は辛うじてできるけど、3+2をするとNaNになっちゃうの不思議・・・><

テキスト版>< 

private static double AdditionByEmlRaw(double x, double y)
{
return eml(1, eml(eml(1, eml(eml(1, eml(eml(eml(1, eml(eml(1, eml(1, eml(x, 1))), 1)), eml(1, eml(eml(1, eml(eml(y, 1), 1)), 1))), 1)), 1)), 1));
}

//eml(x, y) = exp(x) - ln(y)
public static double eml(double x, double y)
{
return Math.Exp(x) - Math.Log(y);
}

テキスト版のeml掛け算>< 

private static double MultiplicationByEml(double x, double y)
{
return eml(eml(1, eml(eml(eml(1, eml(eml(1, eml(1, x)), 1)), eml(1, eml(eml(1, eml(y, 1)), 1))), 1)), 1);
}

これ、超巨大な数値を扱えるライブラリでとんでもない範囲ととんでもない精度で時間をかけて計算しても、結局2+3あたりが限界っぽい(3+2すら出来ない)のはなんでだろ?><

ログインして会話に参加
:realtek:

思考の /dev/null