差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
fltk:example-app-bmi_calc [2025/05/27 18:07] – [プログラムのソースコード] Update main.cpp for minor comment change freemikanfltk:example-app-bmi_calc [2025/06/12 11:46] (現在) – [スクリーンショット] Remove imagebox freemikan
行 1: 行 1:
-====== サンプルアプリケーション: BMI計算機 ====== +====== : BMI計算機 ====== 
-{{:fltk:fltk_shadow.png?200|FLTK}}+[[fltk:|{{:fltk:fltk_shadow.png?200|}}]]
  
  
 ===== スクリーンショット ===== ===== スクリーンショット =====
 {{ :fltk:example-app-bmi_calc.jpg |BMI計算機}} {{ :fltk:example-app-bmi_calc.jpg |BMI計算機}}
- 
  
 ===== プロジェクトレイアウト ===== ===== プロジェクトレイアウト =====
行 64: 行 63:
   errno = 0;   errno = 0;
  
-  // NOTE: We also can use std::stod with std::string instead of std::strtod.+  // NOTE: We can also use std::stod with std::string instead of std::strtod.
  
-  if (double value = std::strtod(value_str, &end_str);+  if (double const value = std::strtod(value_str, &end_str);
       *end_str == '\0' && errno == 0) {       *end_str == '\0' && errno == 0) {
     return value;  // Successfully converted to double value     return value;  // Successfully converted to double value
行 80: 行 79:
     double const h_m = *h_cm / 100;     double const h_m = *h_cm / 100;
  
-    // Avoid zero division+    // Avoid zero divisions
     if (double const h_m_2 = h_m * h_m;     if (double const h_m_2 = h_m * h_m;
         h_m_2 > std::numeric_limits<double>::epsilon()) {         h_m_2 > std::numeric_limits<double>::epsilon()) {
文書の先頭へ