
100 Wn.2d 508 (1983)
671 P.2d 1212
THE STATE OF WASHINGTON, Respondent,
v.
PHILLIP M. PHELAN, Appellant. In the Matter of the Personal Restraint of THEODORE RODRIGUEZ, Petitioner.
Nos. 49347-2, 49420-7.
The Supreme Court of Washington, En Banc.
November 10, 1983.
*509 Phillip M. Phelan, pro se, and Geoffrey Cross, for appellant.
Julie A. Kesler of Washington Appellate Defender Association and Kenneth E. Kanev, for petitioner.
Kenneth O. Eikenberry, Attorney General, Michael P. Lynch, Assistant, Patrick D. Sutherland, Prosecuting Attorney, and Chris Pomeroy, Deputy, for respondent.
UTTER, J.
In Reanier v. Smith, 83 Wn.2d 342, 517 P.2d 949 (1974) and In re Phelan, 97 Wn.2d 590, 647 P.2d 1026 (1982), we held that all jail incarceration in connection with a charge must be credited against the maximum and any mandatory minimum prison sentences following conviction. These consolidated cases present the issue left undecided in Phelan and Reanier  whether such jail time must be credited against the discretionary minimum term[1] set by the Board of Prison Terms and Paroles. We hold that the same *510 constitutional considerations apply and that credit must be given in establishing the guidelines for a discretionary minimum term. Beyond this, however, we place no limitations on the Board's discretion other than those established by its own regulations.
State v. Phelan (cause 49347-2) might more properly be entitled "The Return of Phillip Phelan". In In re Phelan, supra, we held that the trial court, in sentencing Mr. Phelan for a second degree rape conviction, must order credit for all jail time served solely in connection with that charge. (Both presentence incarceration and probationary jail time were involved.) Phelan, at 594-97. We then remanded to the trial court for resentencing "in accordance with this opinion." Phelan, at 598.
On remand, the trial court initially gave Mr. Phelan credit against his maximum term for 14 months of "straight time" (actual time served) plus 4 months of "good time" (extra credit for supposed good behavior). On the State's motion for reconsideration, however, the court deleted the "good time" credit and simply credited Mr. Phelan with 15 months and 16 days of "straight time".[2] Neither order required that Mr. Phelan's jail time be credited against the discretionary minimum term set by the Board.
Theodore Rodriguez, the petitioner in In re Rodriguez (cause 49420-7), was also convicted of second degree rape. After serving approximately 5 months of probationary jail time, Mr. Rodriguez decided he was unable to comply with certain other conditions of his probation and so informed the court. The court then revoked Mr. Rodriguez' probation and sentenced him to prison.
The Board of Prison Terms and Paroles fixed Mr. Rodriguez' discretionary minimum term at 75 months. The Board's order gives no indication of what credit, if any, it gave Mr. Rodriguez for his jail time. Though two members of the Board have stated in affidavits filed in the present *511 appeal that they considered Mr. Rodriguez' jail time, they do not claim to have given him full credit.
Both Mr. Phelan and Mr. Rodriguez now seek an order from this court that they be given full credit for their jail time against their discretionary minimum terms. Mr. Phelan also seeks "good time" credit.

I
In Reanier v. Smith, supra, we held that detention of a defendant while he or she was awaiting trial or sentencing must be credited against maximum and mandatory minimum sentences.
Fundamental fairness and the avoidance of discrimination and possible multiple punishment dictate that an accused person, unable to or precluded from posting bail or otherwise procuring his release from confinement prior to trial should, upon conviction and commitment to a state penal facility, be credited as against a maximum and a mandatory minimum term with all time served in detention prior to trial and sentence.
Reanier, at 346. In In re Phelan, supra, we extended this rule to require credit of time served in jail as a condition of probation which was later revoked. Phelan, at 597.
In neither Phelan nor Reanier did we address the question of credit against the discretionary minimum term set by the Board of Prison Terms and Paroles  indeed, we expressly noted in Reanier that the issue was not raised. Other courts are divided regarding the question of whether credit need be given only to the extent that the total period of incarceration exceeds the statutorily authorized maximum prison sentence or whether it must always be given. Compare Johnson v. Prast, 548 F.2d 699, 703 (7th Cir.1977) with Corley v. Cardwell, 544 F.2d 349, 353 (9th Cir.1976), cert. denied, 429 U.S. 1048 (1977). The view that credit should always be given appears to be the modern trend and perhaps by now the majority view. See In re Banks, 88 Cal. App.3d 864, 868, 152 Cal. Rptr. 111 (1979); Godbold v. District Court, 623 P.2d 862, 866 (Colo. 1981) (Quinn, J., dissenting) and cases cited therein. Nevertheless, *512 our Court of Appeals has taken the contrary view and limited the reach of Reanier (and, presumably, Phelan) to maximum and mandatory minimum terms. See In re Quinlivan, 22 Wn. App. 240, 243-45, 588 P.2d 1210 (1978).

II
We believe the decision in Quinlivan is ill advised. A refusal to fully take into consideration presentence jail time against every aspect of a prison sentence infringes independently on at least two constitutional protections.

A
The first of these is the equal protection clause. That provision requires that "persons similarly situated with respect to the legitimate purpose of the law receive like treatment." Harmon v. McNutt, 91 Wn.2d 126, 130, 587 P.2d 537 (1978). Traditionally, two equal protection tests have been recognized, the "rational relationship" test and the "strict scrutiny" test. Under the first of these tests, a law is subjected to minimal scrutiny and will be upheld "unless it rests on grounds wholly irrelevant to the achievement of a legitimate state objective." Nielsen v. Washington State Bar Ass'n, 90 Wn.2d 818, 820, 585 P.2d 1191 (1978). Under the "strict scrutiny" test, in contrast, the law may be upheld only if shown to be absolutely necessary to accomplish a compelling state interest. Nielsen, at 820. This stricter test applies when the law affects a "fundamental right" or creates a "suspect classification." Nielsen, at 820. Only recently, the Supreme Court has also recognized an "intermediate scrutiny" test whereby the challenged law must be such as "may fairly be viewed as furthering a substantial interest of the State". Plyler v. Doe, 457 U.S. 202, 217-18, 72 L.Ed.2d 786, 102 S.Ct. 2382 (1982).
[1] The test which has been applied to laws affecting the right of physical liberty is unclear. The Supreme Court purported to apply the rational relationship test in McGinnis v. Royster, 410 U.S. 263, 35 L.Ed.2d 282, 93 S.Ct. 1055 (1973), in which it held that "good time" credit for *513 presentence detention did not deny equal protection. See McGinnis, at 273. On the other hand, the Court has, without expressly enunciating a standard, seemingly applied a somewhat stricter test in other cases implicating physical liberty. See, e.g., O'Connor v. Donaldson, 422 U.S. 563, 574-76, 45 L.Ed.2d 396, 95 S.Ct. 2486 (1975) (confinement of nondangerous mentally ill person denies equal protection); Jackson v. Indiana, 406 U.S. 715, 723-31, 32 L.Ed.2d 435, 92 S.Ct. 1845 (1972) (more lenient commitment standards for mentally ill persons charged with crime denied equal protection). Where the deprivation of liberty is due to defendants' indigency, as is the case when there is a denial of credit for presentence detention due to an inability to make bail, the application of some enhanced standard of review seems even more clear. See Bearden v. Georgia, ___ U.S. ___, 76 L.Ed.2d 221, 103 S.Ct. 2064, 2069 (1983) (equal protection challenge based on impact of indigency in criminal justice system "cannot be resolved by resort to easy slogans or pigeonhole analysis, but rather requires a careful inquiry"). See also Tate v. Short, 401 U.S. 395, 28 L.Ed.2d 130, 91 S.Ct. 668 (1971); Williams v. Illinois, 399 U.S. 235, 26 L.Ed.2d 586, 90 S.Ct. 2018 (1970). Our own cases are similarly confused. Compare State v. Rice, 98 Wn.2d 384, 399, 655 P.2d 1145 (1982) (physical liberty a fundamental interest and strict scrutiny must be applied but statute at issue satisfied test) with State v. Smith, 93 Wn.2d 329, 336 n. 2, 610 P.2d 869, cert. denied, 449 U.S. 873 (1980) (decided prior to Plyler v. Doe, supra; noting confusion and rejecting enhanced scrutiny in favor of rational relationship test).
In light of the recent decision in Plyler v. Doe, supra, these cases are best reconciled by interpreting them as sub silentio applying the intermediate scrutiny or some comparable standard. Accord, Gunther, Foreword: In Search of Evolving Doctrine on a Changing Court: A Model for a Newer Equal Protection, 86 Harv. L. Rev. 1, 27-28, 31 (1972) (so interpreting Jackson v. Indiana, supra). In Plyler, this mid-tier standard was applied because the law at *514 issue there involved both "a discrete class ... not accountable for their ... status", albeit not suspect, and an important right, albeit not fundamental. Plyler, at 223. Physical liberty, while not recognized as "fundamental", is a basic human right and the poor, while not a suspect class, cannot be said to be fully accountable for their status. Since a denial of credit for presentence jail time involves both a deprivation of liberty in addition to that which would otherwise exist, and a classification based solely on wealth, we will apply an intermediate level of scrutiny in the present case.
The denial of credit against discretionary minimum terms for time actually served in jail prior to sentencing does not satisfy this test. The interest advanced by the State is its interest in the rehabilitation of those who have committed crimes. While the need for rehabilitation is concededly one factor, and may once have been the sole factor, which the Board of Prison Terms and Paroles considers in setting a discretionary minimum term (see, e.g., State ex rel. Alldis v. Board of Prison Terms & Paroles, 56 Wn.2d 412, 418 n. 2, 353 P.2d 412 (1960)), this is no longer so. In computing a discretionary minimum term, the Board's initial focus is as much, if not more, on the characteristics of the offense as on the characteristics of the individual offender. See WAC Title 381 (Supp. 1981-82), at 1991-95. This suggests that the Board is as much concerned with just punishment, deterrence, and incapacitation as with rehabilitation. See also J. Hall, Law, Social Science and Criminal Theory 216-18 (1982) (noting decline of rehabilitation as a corrections goal); H. Gross, A Theory of Criminal Justice 387-89 (1979) (same). While prisons are probably a more rehabilitative setting than county jails, neither seems any more effective than the other in advancing the goals of punishment, deterrence, and incapacitation. The connection of a denial of jail time credit with only one of the various goals of discretionary minimum terms is insufficient under the enhanced review applicable here.
"Good time" credit, on the other hand, is focused more *515 directly on the particular goal of rehabilitation. See McGinnis v. Royster, supra at 271. The different rehabilitative effects of jails and prisons therefore justify a denial of "good time" credit where they do not justify a complete denial of "straight time" credit. See McGinnis, at 271-73. In addition, the denial of "good time" credit alone has significantly less of an impact on the prisoner's liberty interest.

B
[2] A denial of credit for presentence jail time as against discretionary minimum terms also violates double jeopardy prohibitions. Where a defendant who has successfully appealed has spent time in prison prior to winning his or her appeal, the State must give credit for that time against the sentence for any second conviction. "[T]he constitutional guarantee against multiple punishments for the same offense absolutely requires that punishment already exacted must be fully `credited' in imposing sentence upon a new conviction for the same offense." (Footnote omitted. Italics ours.) North Carolina v. Pearce, 395 U.S. 711, 718-19, 23 L.Ed.2d 656, 89 S.Ct. 2072 (1969).
Prior incarceration not only must be credited against a maximum sentence, but must be credited on any sentence imposed.
The constitutional violation is flagrantly apparent in a case involving the imposition of a maximum sentence after reconviction.... Though not so dramatically evident, the same principle obviously holds true whenever punishment already endured is not fully subtracted from any new sentence imposed.
Pearce, at 718. This language mandates credit not only against maximum and mandatory minimum terms but against discretionary minimum terms as well. See also State v. Shannon, 60 Wn.2d 883, 890-91, 376 P.2d 646 (1962) (applying statutory requirement of credit for time served pending appeal to discretionary minimum term).
The State suggests that application of Pearce should be limited to prior incarceration in prison. We implicitly *516 rejected such a distinction in Reanier v. Smith and adhere to that rejection here. While the rehabilitative effects of incarceration in prisons and jails may differ, the punitive effects are identical. It was multiple punishment, not multiple rehabilitation, which concerned the Court in Pearce. Similarly, while presentence incarceration may not technically be considered punishment, we doubt that a convicted defendant makes any distinction. Accord, Schornhorst, Presentence Confinement and the Constitution: The Burial of Dead Time, 23 Hastings L.J. 1041, 1067-69 (1972).
Mr. Phelan seeks to take Pearce even further and argues that "full" credit requires that he also be given "good time" credit up to the maximum he could have earned had his jail time been spent in prison. It is true that the Court noted in Pearce that credit "must, of course, include the time credited during service of the first prison sentence for good behavior, etc." Pearce, at 719 n. 13. We construe this comment as requiring recognition of only that "good time" credit actually earned, not that which would have been earned had the defendant been subject to a "good time" credit program. The latter figure is speculative at best. In light of McGinnis v. Royster, supra, we must also reject Mr. Phelan's contention that the State is obliged to set up a "good time" credit program for those prisoners who might credit it toward a later prison sentence.

C
The present cases involve not only presentence incarceration but postsentence probationary jail time as well. With regard to credit against maximum and mandatory minimum sentences, however, we rejected any distinction between presentence and postsentence incarceration in In re Phelan, 97 Wn.2d at 595. Much, if not all, of the analysis set forth above is pertinent. The double jeopardy prohibition against multiple punishment requires that partial punishment exacted as a condition of probation be credited against any ultimate punishment actually imposed. Moreover, *517 to allow credit of all jail time against maximum and mandatory minimum terms and allow credit of only presentence jail time against discretionary minimum terms would be a highly anomalous result which has little to justify it.

III
[3] In sum, we hold that the State must give a prisoner credit for all jail time in connection with a conviction for which he or she is eventually sentenced to prison. Moreover, the credit must apply to all aspects of the defendant's sentence, including the discretionary minimum term set by the Board of Prison Terms and Paroles.
Both the judgment and the record of proceedings before the Board must reflect the credit. While some courts presume credit to be given where it is due (see, e.g., Durkin v. Davis, 538 F.2d 1037, 1040 (4th Cir.1976)), we deem such a presumption inadvisable. We have previously rejected such a suggestion as insufficient in cases of statutorily mandated credit (see Lindsey v. Superior Court, 33 Wn.2d 94, 103, 204 P.2d 482 (1949)) and consider it even less satisfactory in cases of credit which is constitutionally mandated. Accord, Schornhorst, at 1062-64.
It is the way in which the credit must be applied to the discretionary minimum term which has caused confusion. The Board considers previous incarceration only at the final, and perhaps least important, step of its calculation process. That process consists of several steps. First, the Board computes a "guideline term" based on the circumstances surrounding the crime and the prisoner's prior record. WAC Title 381 (Supp. 1981-82), at 1995. From the "guideline term," the Board creates a "guideline range" from approximately 12 1/2 percent below the "guideline term" to approximately 12 1/2 percent above. WAC Title 381 (Supp. 1981-82), at 1995. Finally, the Board selects some value within this range as the prisoner's discretionary minimum term. The Board may set a term outside the guideline range whenever "they encounter atypical circumstances" *518 but must provide written reasons for doing so. WAC Title 381 (Supp. 1981-82), at 1995, 2023-25.
Under current procedures, consideration of prior incarceration enters into this calculation only at the final stage, selection of a term after calculating the guideline range. See WAC Title 381 (Supp. 1981-82), at 2024. It has absolutely no effect on the guideline range, despite the fact that that aspect of the calculation process is clearly the most important. Even though the Board may, in its discretion, go outside the guideline range, it must provide written justification for doing so. Such a requirement no doubt makes sentences outside the range less likely.
To satisfy the constitutional requirements discussed above, the Board must give full day-for-day credit for jail time. General "consideration" of such time is insufficient  the Board must give full credit in determining the guideline range. Having given such credit, the Board need give no further consideration to jail time and is then free, subject to its own regulations, to set the discretionary minimum term anywhere within the guideline range, or even outside the range if it provides written justification. We do not hold that the Board is barred from making changes in its calculation process but only that the process must be such as to assure a record showing the prisoner was given full day-for-day credit for his or her jail time.
The State has argued that since the Board has broad discretion in setting minimum terms within, and even outside, the guideline range it may effectively deny credit by simply choosing a term which after deduction of necessary credit produces the result desired. Hence, the State argues, we favor form over substance.
We believe this criticism misplaced. Initially, we note that form is not entirely unimportant here  those incarcerated in our state institutions should as far as may be possible believe that they have at least been fairly treated. Further, we believe that our decision favors substance as well. We are not inclined, as the State apparently is, to assume that the Board will not apply our decision today in *519 good faith. Moreover, the Board's own regulations require it to provide written justification whenever it goes outside the guideline range. Just as this probably acted as a constraint on the Board's ability to grant full credit in previous cases, it should constrain the Board in the future as well.
The cases are remanded to the respective trial courts for entry of new judgments ordering that Mr. Phelan and Mr. Rodriguez each be given credit for time served as against their discretionary minimum terms; however, no "good time" credit need be ordered. In setting those terms, the Board of Prison Terms and Paroles should assure that its order demonstrates that full credit was given in accordance with this opinion.
WILLIAMS, C.J., and ROSELLINI, STAFFORD, DORE, and PEARSON, JJ., concur. DIMMICK, J. (dissenting)
In remanding these cases to allow the Board of Prison Terms and Paroles to credit jail time already served, the court mandates procedures that the Board must use in exercising its discretionary jurisdiction. I see no justification for interfering with the Board's rulemaking authority.
This court's function is to tell the agency what is constitutionally necessary, not how to fulfill the requirement. See Karlen v. Department of Labor & Indus., 41 Wn.2d 301, 304, 249 P.2d 364 (1952).
I dissent.
BRACHTENBACH and DOLLIVER, JJ., concur with DIMMICK, J.
Reconsideration denied January 25, 1984.
NOTES
[1]  When a defendant is convicted, several sentences are set. The court fixes only the maximum sentence, at the end of which the defendant must be released. RCW 9.95.010; RCW 9.95.100. For certain specified crimes, a mandatory minimum sentence must be fixed as well. RCW 9.95.040. Within these bounds, the Board of Prison Terms and Paroles fixes what is known as a discretionary minimum term, based on guidelines which it has developed. See generally Board of Prison Terms and Paroles, Policies and Procedures Manual, ch. 2, WAC Title 381 (Supp. 1981-82), at 1943.
[2]  The reason for the adjustment in "straight time" credit is unclear, but the State does not challenge it.
