ステップ式計算機

演算子の優先順位に従って括弧付きの数式を計算します。

// about

ツールについて

(379*11900)+(75*20000) のような通常の四則演算式を入力します。乗除を加減より先に計算し、各ステップを表示します。

使い方

  1. 数字と +、-、*、/、かっこを入力します。
  2. 「数式を計算」を押します。
  3. 各ステップの式と最終結果を確認します。

このツールが使われる理由

  • 基本的な電卓より、長い式や入れ子のかっこをわかりやすく扱えます。
  • 途中の式を表示するので、計算を検証できます。
  • 任意のコードを実行せず、四則演算に対応します。
ガイド · 計算 · 4分で読めます

パーセント計算を完全解説:増減率、パーセントポイント、二重割引、消費税

売上はどれだけ伸びたのか。セール価格はいくらか。金利は1%上がったのか、1ポイント上がったのか。パーセントは簡単に見えますが、基準を間違えると答えが変わります。

パーセントは百あたりの割合です。パーセント計算はすべて、正しい基準(分母)を選べるかどうかにかかっており、日常のほとんどのケースは次の4つのどれかに当てはまります。

① AのB%はいくら?        A × B ÷ 100          (80,000円の15% = 12,000円)
② AはBの何%?            A ÷ B × 100          (12 ÷ 48 × 100 = 25%)
③ AからBへの増減率        (B − A) ÷ A × 100    (200 → 250 = +25%)
④ AをB%増減した値         A × (1 ± B ÷ 100)    (50,000 + 20% = 60,000)
パーセント計算の基本4公式、パーセントとパーセントポイントの違い、20%引き+10%引きが30%引きにならない理由、税込価格から税額を求める方法を解説します。
ガイドを読む →
AIで作る

このツールをAIで自作してみましょう

自分用のバージョンが必要なら、作業指示プロンプトをAIチャットに貼り付けるか、スキルファイルをAIコーディングエージェントに保存してください。私たちが開発時に整理した機能、例外、テストケースが含まれています。

プロンプトとスキルは英語で提供しています。AIツールはどの言語でもよく理解できます。

AI作業指示プロンプト

Claude、ChatGPT、GeminiなどのAIチャットにそのまま貼り付けてください。

You are an experienced full-stack web developer. Build a web tool called "ステップ式計算機" that meets the requirements below.

## Goal

Build a calculator that evaluates expressions with arithmetic and parentheses and shows each intermediate step.

## Core features

- +, −, ×, ÷, parentheses and decimals
- Step-by-step working that follows operator precedence
- Accept thousands separators
- Copy result
- Recent history

## Inputs

- An expression string

## Outputs

- Final result
- List of intermediate results

## Edge cases and handling rules

- Implement a parser; never use eval
- Report mismatched parentheses with their position
- Handle division by zero
- Keep precision for large numbers and decimals (decimal arithmetic)

## Implementation requirements

- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.
- Make the UI responsive and easy to use on mobile; label every input and keep everything keyboard accessible.
- Add a Copy button for results and show clear, friendly error messages for invalid input.
- Keep the core logic in functions separate from the UI so it can be unit-tested.

## Definition of done (test cases)

- (379*11900)+(75*20000) = 6010100 with steps 4510100 and 1500000
- 2+3*4 = 14
- 1/0 shows an error

First outline your implementation plan in at most five lines, then write the complete code, and finally explain how to check the test cases above.

スキル (SKILL.md)

Claude CodeなどのAIコーディングエージェントで .claude/skills/build-expression-calculator/SKILL.md に保存すると、このツールを作る・直すたびに再利用できます。

---
name: build-expression-calculator
description: Use when building or changing a ステップ式計算機 tool. Build a calculator that evaluates expressions with arithmetic and parentheses and shows each intermediate step.
---

# Build: ステップ式計算機

## Goal

Build a calculator that evaluates expressions with arithmetic and parentheses and shows each intermediate step.

## Workflow

1. Review the required features, inputs and outputs below and ask about anything missing first.
2. Implement the core logic as pure functions separate from the UI.
3. Check the logic against the test cases in the verification list.
4. Build a responsive UI with an input form, a result area and a Copy button.
5. Reproduce each edge case listed under Rules and refine the error messages.

## Core features

- +, −, ×, ÷, parentheses and decimals
- Step-by-step working that follows operator precedence
- Accept thousands separators
- Copy result
- Recent history

## Inputs

- An expression string

## Outputs

- Final result
- List of intermediate results

## Rules

- Implement a parser; never use eval
- Report mismatched parentheses with their position
- Handle division by zero
- Keep precision for large numbers and decimals (decimal arithmetic)
- Build it as a single page (HTML, CSS, JavaScript) that runs entirely in the browser, and never send the user's input to a server.

## Verification

- [ ] (379*11900)+(75*20000) = 6010100 with steps 4510100 and 1500000
- [ ] 2+3*4 = 14
- [ ] 1/0 shows an error

AIに任せるときのコツ

  • 最初の行に使用技術(React、Vue、素のHTMLなど)を書くと、プロジェクトに合ったコードになります。
  • コードを受け取る前に、テストケースを実行して結果を見せるよう依頼しましょう。
  • 本物のパスワード、顧客データ、APIキーは入力せず、サンプル値を使ってください。