[過去ログ]
関数型プログラミング言語Haskell Part33 (1002レス)
関数型プログラミング言語Haskell Part33 http://mevius.5ch.net/test/read.cgi/tech/1581326256/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
563: デフォルトの名無しさん [sage] 2020/11/09(月) 19:55:38.03 rootsInternal :: Quadratic -> Double -> Roots rootsInternal q d = let two_a = 2.0 * (a q) realpart = - (b q) / two_a dside d = (sqrt d) / two_a dpart = dside d complexpart = dside (-d) in if d==0 then -- Discriminant is zero, (single) root is real Root $ realpart :+ 0 else if d<0 then -- Discriminant is negative, roots are complex Roots (realpart :+ complexpart) (realpart :+ (-complexpart)) else -- Discriminant is positive, all roots are real Roots ((realpart + dpart) :+ 0) ((realpart - dpart) :+ 0) のlet 〜 in みたいなのを rootsInternal q d | d==0 = ... | d<0 = ... | otherwise = ... みたいな書き方の時にもやりたいんです http://mevius.5ch.net/test/read.cgi/tech/1581326256/563
565: デフォルトの名無しさん [sage] 2020/11/09(月) 20:20:48.18 ID:UhW/CkjO >>563-564 where で出来なかったっけ?だめだったかな? http://mevius.5ch.net/test/read.cgi/tech/1581326256/565
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.030s