functionisRealAndPositive(n){// NaN, Infinity are not allowedreturn(typeofn==='number')&&(n>0)&&isFinite(n)}constRp=algebraGroup({identity:1,contains:isRealAndPositive,equality:equality,compositionLaw:multiplication,inversion:inversion},{compositionLaw:'mul',equality:'eq',disequality:'ne',identity:'one',inverseCompositionLaw:'div',inversion:'inv'})

You get a group object with one identity and the following group operators: