I have added #ATS to the languages for which there is a solution to the #RosettaCode #ModularArithmetic task:

Modular arithmetic - Rosetta Code https://rosettacode.org/wiki/Modular_arithmetic#ATS

This task was practically tailor-made for #Ada. :) But ATS lets us easily extend the language to handle modular numbers.

#ATSlang #FunctionalProgramming #Proofs

Update: After reading the task language again, I added some more commentary, to point out what I see as a flaw in the task.

Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code

Now I have both enhanced the #ATS program (to show how to take advantage of the macro system) AND added a #Scheme program:

https://rosettacode.org/wiki/Modular_arithmetic#Scheme

#ATSlang #RosettaCode #FunctionalProgramming

Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code
Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code

Now I have added #Mercury --

https://rosettacode.org/wiki/Modular_arithmetic#Mercury

#RosettaCode #MercuryLang #LogicProgramming #FunctionalProgramming

(For convenience I use higher-order functions, so that the Functional Programming hashtag makes sense. Also, Mercury is a language in which tail recursion is the preferred method of looping. And, it just occurs to me, I wrote the program mostly as ‘functions’ rather than ‘predicates’!)

Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code

I just keep going. It is a pretty simple task. I did more than was called for, in the #ATS example I did first.

Here is #Fortran --

https://rosettacode.org/wiki/Modular_arithmetic#Fortran

As with the ATS, I use a macro, although the macro system is not as capable as that of ATS.

(I used the C preprocessor. There was once a standard Fortran preprocessor, but it was removed from the standard. Nobody used it. Everyone used the C preprocessor, m4, or some such.)

#RosettaCode #ProceduralProgramming

Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code

I have added #ObjectIcon --
https://rosettacode.org/wiki/Modular_arithmetic#ObjectIcon

#RosettaCode #ProceduralProgramming

(I will not call this an example of #LogicProgramming, given that I never use goal-direction or failure in any significant way. But #ObjectOriented does apply.)

Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code
Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code
Modular arithmetic

Modular arithmetic is a form of arithmetic (a calculation technique involving the concepts of addition and multiplication) which is done on numbers with a defined...

Rosetta Code