[過去ログ]
Visual Studio 2008 Part 22 (314レス)
Visual Studio 2008 Part 22 http://mevius.5ch.net/test/read.cgi/tech/1413180800/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
262: デフォルトの名無しさん [] 2018/09/16(日) 23:54:13.85 ID:SOVIz+sV で、>>199に書いてあるとおり↓Debugビルドと同じ結果が再現された > ↓この下に(ループ内に)fprintf文を入れるだけで > ReleaseビルドとDebugビルドが同じ実行結果になることが確認できた > norm += (double)r[i] * (double)r[i]; ?-2 デフォルト設定(Release) 【コード】(その1) #include "stdafx.h" #include <stdio.h> #include <stdint.h> #include <math.h> using namespace System; template<typename T> static double calc_norm_and_regulate(int num, T* r, bool regulate){ // <float> for debug. double norm = 0; for (int i = 0; i < num; i++) { norm += (double)r[i] * (double)r[i]; fprintf(stdout, "[0]0x%016llX:%.19lg\n", *(uint64_t*)&norm, norm); } fprintf(stdout, "[1]0x%016llX:%.19lg\n", *(uint64_t*)&norm, norm); norm = sqrt(norm); if (regulate) for (int i=0;i<num;i++) r[i] = (T)(r[i]/norm); return norm; } http://mevius.5ch.net/test/read.cgi/tech/1413180800/262
263: デフォルトの名無しさん [] 2018/09/16(日) 23:54:58.60 ID:SOVIz+sV ?-2 デフォルト設定(Release) 【コード】(その2) int main(array<System::String ^> ^args) { int count = 16; __int64 inputs_hex[16] = { 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x1fedb1530240aa54, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x1ff0af0d95025bc3, 0x1fc9353df6af376b, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000 }; double* inputs = (double*)inputs_hex; double norm = calc_norm_and_regulate(count, inputs, false); fprintf(stdout, "[2]0x%016llX:%.19lg\n", *(uint64_t*)&norm, norm); // Console::Write(String::Format("{0:F6}, 0x{1:x16}\r\n",norm, *(__int64*)&norm)); // Release build // 0.000000, 0x1ff68ddfb62221dd from IDE // 0.000000, 0x1ff68ddfb62221de from command prompt return 0; } http://mevius.5ch.net/test/read.cgi/tech/1413180800/263
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 51 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.014s