Basics

← All samples

basics.dply
1---
2version: 0.1.0
3precision: 4
4---
5# draftply — Basics (Free)
6# Just type. Results appear live in the right column.
7# Comments start with # or //
8
9# Arithmetic — precedence, powers, modulo
102 + 3 * 4 - 1
112 ^ 10
1217 % 5
13
14# Built-in constants
15pi
16e
17
18# Variables — assign once, reuse anywhere
19price = 49.90
20quantity = 3
21tax = 0.19
22
23# A plain assignment can be reused on later lines
24net = price * quantity
25# A labelled result — text before the ':' just names the line (display only)
26total with tax: net * (1 + tax)
27
28# Built-in functions (angles in radians)
29sqrt(2)
30round(sin(pi / 4) * 10000) / 10000
31max(3, 7) + min(10, 4)
32
33# Text with an embedded calculation in { }
34You pay {price * quantity * (1 + tax)} EUR including tax.
35