PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Dc

Dc

Dc, aka desk calculator, is a pl created in 1978.

#396on PLDB 44Years Old 200Users
0Books 18Papers

Try now: Riju · TIO

dc (desk calculator) is a cross-platform reverse-polish calculator which supports arbitrary-precision arithmetic. It is one of the oldest Unix utilities, predating even the invention of the C programming language. Like other utilities of that vintage, it has a powerful set of features but terse syntax. Read more on Wikipedia...


Example from Riju:
[Hello, world!] p
Example from hello-world:
[Hello World ]n
Example from Wikipedia:
#!/usr/bin/perl my ($g,$e,$m) = map { "\U$_" } @ARGV; die "$0 gen exp mod\n" unless $m; print `echo $g $e $m | dc -e ' # Hex input and output 16dio # Read m, e and g from stdin on one line ?SmSeSg # Function z: return g * top of stack [lg*]sz # Function Q: remove the top of the stack and return 1 [sb1q]sQ # Function X(e): recursively compute g^e % m # It is the same as Sm^Lm%, but handles arbitrarily large exponents. # Stack at entry: e # Stack at exit: g^e % m # Since e may be very large, this uses the property that g^e % m == # if( e == 0 ) # return 1 # x = (g^(e/2)) ^ 2 # if( e % 2 == 1 ) # x *= g # return x % [ d 0=Q # return 1 if e==0 (otherwise, stack: e) d 2% Sa # Store e%2 in a (stack: e) 2/ # compute e/2 lXx # call X(e/2) d* # compute X(e/2)^2 La1=z # multiply by g if e%2==1 lm % # compute (g^e) % m ] SX le # Load e from the register lXx # compute g^e % m p # Print the result '`;

Language features

Feature Supported Example Token
Comments
# A comment
Line Comments
# A comment
#
Semantic Indentation ϴ

Publications about Dc from Semantic Scholar

title authors year citations influentialCitations
DC motors and servo-motors controlled by Raspberry Pi 2B Michal Šustek and Miroslav Marcaník and P. Tomášek and Z. Úředníček 2017 8 1
Performance evaluation of brushless DC permanent magnet motor using Finite Element Method T. Akinaga and C. Pompermaier and F. Kalluf and M. V. Ferreira da Luz 2011 5 0
750-kW interleaved buck converter dc supply control implementation in a low-cost FPGA Yusi Liu and C. Farnell and Shamim Ahmed and J. Balda and H. Mantooth 2015 4 0
The implementation of a measurement system for brushless DC motor parameters Tze-Yee Ho and Fang-Ta Liu and Guan-Wei Ho and Yan Lin 2017 4 0
DESAIN KONTROL PID DENGAN METODA TUNING DIRECT SYNTHESIS UNTUK PENGATURAN KECEPATAN MOTOR DC R. Gozali 2005 3 0
DC power supply system for intelligent server Ching-Chang Wong and Chih-Cheng Liu and K. Hou 2012 3 0
A VIRTUAL INSTRUMENT FOR DC POWER FLOW SOLUTION USING LABVIEW LANGUAGE S. Souag and F. Benhamida 2012 3 0
Real-time flatness-based control of a DC motor S. Bouallègue and M. Ayadi and Joseph Haggège and M. Benrejeb 2007 2 0
Control of brushless DC motor with an AVR microcontroller Xu Wuxiong 2011 2 0
Comparison of DC and MC/DC Code Coverages Zalán Szűgyi and Zalán Porkoláb 2013 2 0
Design and PLC Implementation for Speed Control of DC Motor using Fuzzy Logic J. Monfared and M. Fazeli and Y. Lotfi 2015 2 0
Application of DC motor as speed and direction control B. Mohapatra and R. Mohapatra 2020 2 0
DC Resistivity Inversion Using General-purpose Optimisation Software N. Merrick 1991 1 0
A brushless DC motor speed control system based on DSP controller Songming Cao and Yong Liu and Ming Hu and Xin Fu 2015 1 0
Kendali Kecepatan Motor DC Penguat Terpisah Berbeban Berbasis Arduino Dio Taufiq Arif and Aswardi Aswardi 2020 1 0
Real Time Speed Control of DC Motor by Programming the Fuzzy Controller in C Language Abdelelah K. M. and A. A. Abdul Fatah 2016 1 0
DC Optimal Power Flow Formulation Using the Power Transmission Distribution Factors—A DIgSILENT Programming Language Application Victor Hinojosa-Mateus and Leonardo Pérez-Andrades and J. Ilic 2014 1 0
Sentence Compression via DC Programming Approach Yi-Shuai Niu and Xiwei Hu and Yu You and Faouzi Mohamed Benammour and Hu Zhang 2019 1 0
nasm.html · dc.html · clu.html

View source

PLDB - Build the next great programming language · v2022 · Day 31 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com